package com.practice.bootdemo.cond;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * @author :Administrator
 * @description: Windows条件定义
 * @create date: 2022/12/5 22:46
 */
public class WindowsCondition implements Condition {
    @Override
    public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
        if (context.getEnvironment().getProperty("os.name").contains("windows")){
            return true;
        }
        return false;
    }
}
